<?php
	require_once("../inc/models/contact_info_model.php");
	if(isset($_POST['submit']))
	{
		$row = $_POST;
		NewContactInfo($row);
		header("Location: index.php");
	}
	else
	{
		$customer = GetCustomers();
		$keyword = GetContactKeywords();
	}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <?php include('../inc/header.php'); ?>	
	<body>
		<?php include('../inc/navigation.php'); ?>    
    	<div class="span9">
        		<h2>Create new ContactInfo</h2> 
        	    <form class="well" method="post" action="#">
					<div class=" control-group">
                        <label class="control-label" for="customer_id">Customer:</label>
                        <div class="controls">
                        	<select name="customer_id" id = "customer_id">
                        		<? while($rs = $customer->fetch_assoc()): ?>
                        			<option value="<?=$rs['id']?>"><?=$rs['FirstName']?> <?=$rs['LastName']?></option>
                        		<?php endwhile; ?>                        		                    		
                        	</select>                        	                            	
                        </div>
                    </div>   
                    <div class=" control-group">
                        <label class="control-label" for="value">Value:</label>
                        <div class="controls">                        	
							<input type="text" name="value" id="value"/>
						</div>
					</div>                    
					<div class="control-group">
	                	<label class="control-label" for="keyword">Customer_keywords_id:</label>
	                    <div class="controls">
	                    	<select name="keyword" id = "keyword">
	                        	<? while($rs = $keyword->fetch_assoc()): ?>
	                        		<option value="<?=$rs['id']?>"><?=$rs['Method']?></option>
	                        	<?php endwhile; ?>                        		                    		
	                        </select>                
	                	</div>
	                </div>           
				<input type="submit" name="submit" value="Submit" />
			</form>   
    	</div>        	      
   </body>
</html>